package com.ysyx.ysyx_message.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 消息记录表
 * @TableName message_inf
 */
@TableName(value ="message_inf")
@Data
public class MessagePojo implements Serializable {
    /**
     * 信息编号PK
     */
    @TableId(type = IdType.AUTO)
    private Integer messageId;

    /**
     * 订单编号
     */
    private String orderId;

    /**
     * 信息发送者编号
     */
    private Integer messageSenderid;

    /**
     * 信息接收者编号
     */
    private Integer messageReceiverid;

    /**
     * 信息内容
     */
    private String messageContent;

    /**
     * 消息发送时间
     */
    private Date messageCtime;

    /**
     * 信息交互角色（102乘客发送给司机，201司机发送给乘客、301后台发送给乘客、302后台发送给司机）(101正常、201封禁)
     */
    private Integer messageState;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MessagePojo other = (MessagePojo) that;
        return (this.getMessageId() == null ? other.getMessageId() == null : this.getMessageId().equals(other.getMessageId()))
            && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
            && (this.getMessageSenderid() == null ? other.getMessageSenderid() == null : this.getMessageSenderid().equals(other.getMessageSenderid()))
            && (this.getMessageReceiverid() == null ? other.getMessageReceiverid() == null : this.getMessageReceiverid().equals(other.getMessageReceiverid()))
            && (this.getMessageContent() == null ? other.getMessageContent() == null : this.getMessageContent().equals(other.getMessageContent()))
            && (this.getMessageCtime() == null ? other.getMessageCtime() == null : this.getMessageCtime().equals(other.getMessageCtime()))
            && (this.getMessageState() == null ? other.getMessageState() == null : this.getMessageState().equals(other.getMessageState()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getMessageId() == null) ? 0 : getMessageId().hashCode());
        result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
        result = prime * result + ((getMessageSenderid() == null) ? 0 : getMessageSenderid().hashCode());
        result = prime * result + ((getMessageReceiverid() == null) ? 0 : getMessageReceiverid().hashCode());
        result = prime * result + ((getMessageContent() == null) ? 0 : getMessageContent().hashCode());
        result = prime * result + ((getMessageCtime() == null) ? 0 : getMessageCtime().hashCode());
        result = prime * result + ((getMessageState() == null) ? 0 : getMessageState().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", messageId=").append(messageId);
        sb.append(", orderId=").append(orderId);
        sb.append(", messageSenderid=").append(messageSenderid);
        sb.append(", messageReceiverid=").append(messageReceiverid);
        sb.append(", messageContent=").append(messageContent);
        sb.append(", messageCtime=").append(messageCtime);
        sb.append(", messageState=").append(messageState);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}